<?php
class Customer extends AppModel {
	var $name = 'Customer';
	var $displayField = 'name';
	var $validate = array(

		'name' => array(
	        'rule' => 'notempty', // or: array('ruleName', 'param1', 'param2' ...)
	        'required' => true,
	        'allowEmpty' => false,
	        'on' => 'create', // or: 'update'
	        'last' => false,
	        'message' => 'The field can not be empty'
	    ),
		'surname' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'The field can not be empty',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			)
		),
		'address1' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'The field can not be empty',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			)
		),
//		'address2' => array(
//			'notempty' => array(
//				'rule' => array('notempty'),
//				'message' => 'The field can not be empty',
//				//'allowEmpty' => false,
//				//'required' => false,
//				//'last' => false, // Stop validation after this rule
//				//'on' => 'create', // Limit validation to 'create' or 'update' operations
//			)
//		),
		'address3' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'The field can not be empty',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			)
		),
		'address4' => array(
			'notempty' => array(
//				'rule' =>  array('postal', null, 'uk'),
				'rule' => array('notempty'),
				'message' => 'Please enter a valid ZIP code',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			)
		),
		'address5' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'The field can not be empty',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			)
		),
		'delivery_name' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'The field can not be empty',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			)
		),
		'delivery_surname' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'The field can not be empty',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			)
		),
		'email' => array(
			'email' => array(
				'rule' => array('email'),
				'message' => 'Enter correct email address',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'The field can not be empty'
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		)
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'user_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);


}
?>